//
//  HPHttpSmsQueryReqeust.m
//  HappyPenguin
//
//  Created by zhuangyihang on 1/30/16.
//  Copyright © 2016 zhuangyihang. All rights reserved.
//

#import "HPHttpSmsQueryReqeust.h"

static NSString *SMSQueryFlagValue[] = {
    [SMSQueryFlag_Self] = @"self",
    [SMSQueryFlag_System] = @"system",
};

static NSString *SMSQueryTypValue[] = {
    [SMSQueryType_All] = @"all",
    [SMSQueryType_Nearbirthday] = @"nearbirthday",
    [SMSQueryType_TodayBirthday] = @"todaybirthday",
    [SMSQueryType_NearMemorial] = @"nearmemorial",
    [SMSQueryType_TodayMemorial] = @"todaymemorial",
    [SMSQueryType_Dormancy] = @"dormancy",
};

@implementation HPHttpSmsQueryReqeust

- (NSDictionary *)prepareForParameter{
    return @{@"QueryFlag":SMSQueryFlagValue[self.flag],@"Querytype":SMSQueryTypValue[self.type]};
}
- (NSString *)getAppType{
    return @"SMSTemplate";
}

- (HttpBaseResponse *)getResponse:(id)data{
    HPHttpSmsQueryResponse *response = [[HPHttpSmsQueryResponse alloc] init];
    
    response.smsArray = [[ObjectBuilder builder] objectArrayFromJSON:data className:@"SmsObject"];
    
    return response;
}

@end


@implementation HPHttpSmsQueryResponse



@end


@implementation HPHttpSmsDeleteRequest

- (NSDictionary *)prepareForParameter{
    return @{@"Key_id":@(self.keyId)};
}
- (NSString *)getAppType{
    return @"DelSMS";
}

@end

@implementation HPHttpSmsFavoriteRequest

- (NSDictionary *)prepareForParameter{
    return @{@"Key_id":@(self.keyId)};
}
- (NSString *)getAppType{
    return @"CollectSMS";
}

@end

@implementation HPHttpSmsUpdateRequest

- (NSDictionary *)prepareForParameter{
    return @{@"Key_id":@(self.keyId),@"C_content":self.content};
}
- (NSString *)getAppType{
    return @"SaveSMS";
}

@end